﻿//*********************************************************************
//
//  文件名：Startup
//
//  作者： LW
//
//  作用：
//
//  日期：2015/9/8 16:11:03
//
//*********************************************************************
using System;
using Owin;
using Microsoft.Owin;
using Framework.IOC;
using YouTravel.DomainService;
using System.Web.Http;
using Framework.Owin;

[assembly: OwinStartup(typeof(Application.WebAPI.Startup))]

namespace Application.WebAPI
{
    /// <summary>
    /// Startup
    /// </summary>
    public partial class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            ConfigureAuth(app);
            ConfigureIpLimit(app);
            ConfigureRequestLog(app);
        }
        /// <summary>
        /// 动态加载配置方法
        /// </summary>
        public void Configuration()
        {
            ServiceLocator.Regist(container =>
            {
                container.RegisterType(typeof(IUserService), typeof(UserService));
                container.RegisterType(typeof(IBranchService), typeof(BranchService));
                container.RegisterType(typeof(IContractService), typeof(ContractService));
                container.RegisterType(typeof(IMenuService), typeof(MenuService));
                container.RegisterType(typeof(ISpecialService), typeof(SpecialService));
                container.RegisterType(typeof(IPaymentService), typeof(PaymentService));
                container.RegisterType(typeof(IInvoiceService), typeof(InvoiceService));
                container.RegisterType(typeof(IShortMessageService), typeof(ShortMessageService));
                container.RegisterType(typeof(ICollectInvoiceService), typeof(CollectInvoiceService));
                container.RegisterType(typeof(IGatheringService), typeof(GatheringService));
				container.RegisterType(typeof(IDebitService), typeof(DebitService));
            });
        }
    }
}